<? session_start();

include("SVsystem/config/dbconfig.php"); ////////setup
include("SVsystem/class/clases.php");
include("SVsystem/config/dominio.php");

$tool = new tools('db');
$tool2 = new tools;
$tool2->dbc = $tool->dbc; 


if(!isset($_SESSION['CLIENTE_ID'])) $tool->redirect("index.php");

 $datau = $tool->simple_db("SELECT 
  c.nombre,
  c.password,
  c.empresa,
  c.actividad,
  c.cargo,
  c.email2,
  c.web,
  c.email,
  c.tlf1,
  c.celular,
  c.tlf2,
  c.fax,
  c.zip,
  c.estado,
  c.ciudad,
  c.pais,
  c.notas,
  c.noticias_titulo,
  c.noticias_texto,
  group_concat(a.ruta) as archivos,
  group_concat(a.descrip) as descrips
FROM
  cliente c
  INNER JOIN cliente_archivo a ON (c.id = a.cliente_id) where c.id = '{$_SESSION['CLIENTE_ID']}' "); 
 
  $archivos = explode(',',$datau['archivos']);
  $descs = explode(',',$datau['descrips']);
  
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
	"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title><?php echo $datau['nombre']; ?></title>
	<link rel="stylesheet" href="estilo.css" type="text/css" media="screen" title="no title" charset="utf-8">
	<script src="/SVscripts/jquery-1.5.1.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="/SVscripts/menu.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="SVsystem/js/utils.js"></script>
<script type="text/javascript" src="SVsystem/js/banner-mouseover.js"></script>
<script type="text/javascript" src="SVsystem/js/ajax.js"></script>
</head>
<body>
<?php include('SVG-header.php'); ?>
<div id="wrapper">
	<div id="contenido">
		<div id="izquierda">
			<?php include('SVG-menu-categorias.php'); ?>
		</div>
		<div id="centro">
				<div id="userhome">
					<table width="566" border="0" align="center" cellpadding="0" cellspacing="0">
					<tr>
					<td>
                     <?php if(!empty($datau['noticias_titulo'])){ ?>
                    <div class="userhome-titulo"><?php echo $datau['noticias_titulo']; ?></div>
					 <div class="userhome-notas"><?php echo $datau['noticias_texto']; ?></div>
                    <?php } ?>
                    <div class="userhome-titulo">Mensaje del Administrador</div>
					 <div class="userhome-notas"><?php echo $datau['notas']; ?></div>
                    
                     <div class="userhome-titulo">Su informaci&oacute;n Personal</div>
            
					<table width="100%" border="0" cellspacing="5" cellpadding="0">
                    <tr>
                    <td width="50%" class="userhome-tablaheader">Email</td>
                    <td width="50%" class="userhome-tablaheader">Telefono</td>
                    </tr>
                    <tr>
                    <td class="userhome-tabladato"><span class="valor"><?php echo $datau['email'] ?></span></td>
                    <td class="userhome-tabladato"><span class="valor"><?php echo $datau['tlf1'] ?></span></td>
                    </tr>
                    <tr>
                    <td colspan="2" class="userhome-tablaheader">Compa&ntilde;ia</td>
                    </tr>
                    <tr>
                    <td colspan="2" class="userhome-tabladato"><span class="valor"><?php echo $datau['empresa'] ?></span></td>
                    </tr>
                    <tr>
                      <td class="userhome-tablaheader">Ciudad</td>
                      <td class="userhome-tablaheader">Pa&iacute;s</td>
                    </tr>
                    <tr>
                      <td class="userhome-tabladato"><span class="valor"><?php echo $datau['ciudad'] ?></span></td>
                      <td class="userhome-tabladato"><span class="valor"><?php echo $datau['pais'] ?></span></td>
                    </tr>
                    </table>

					<a href="javascript:popup('SV-popup-registro-edit.php', 'reg','600','800');">
					<div class="userhome-boton">Cambiar...</div>
					 </a>


					

    			<?php if(!empty($archivos[0])){ ?>
                   <div class="userhome-titulo">Sus Documentos</div>
						
						<?php for($ii=0;$ii<count($descs);$ii++){ ?>
                        <h3><a target="_blank" href="<?php echo $DOMINIOSV ?>/usuario/doc/<?php echo $archivos[$ii];  ?>"><?php echo $archivos[$ii] ?></a></h3>
						<p><?php echo $descs[$ii] ?></p>
						<?php } ?>
					
                    
                    
                    <?php } ?>



					<!--<table width="100%" border="0" cellspacing="5" cellpadding="0">
					<tr>
					<td width="229" class="userhome-tablaheader">Curso</td>
					<td width="111" class="userhome-tablaheader">Costo (Bs)</td>
					<td width="106" class="userhome-tablaheader">Fecha</td>
					<td width="117" class="userhome-tablaheader">Order Status</td>
					</tr>
					</table>-->



					</td>
					</tr>
					</table>
				</div>
		</div>
		<div id="derecha">
			
              <?php if(empty($_SESSION['CLIENTE_ID'])){
            
                    //////////en el caso de que se decida hacer log in
                    include("login_flow.php");
                    ?>
            <!-- INCLUIR user-login.php o usuario-logead.php -->
                 <?php include('SVG-login.php'); ?>	
               <?php  }else{ ?>
                  <?php include('SVG-barra-usuario.php'); ?>
                <?php }?>
            
				<div  class="banners">
					<?php include('SVG-banners.php'); ?>
				</div>		
		</div>
	<div id="separador"></div>
</div>
	<div id="fincontenido"></div>
<?php include('SVG-footer.php'); ?>
</div>
</body>
</html>